export function adapterOut(logicFlowData) {


    let outJson = {
        step: [], order: {
            hop: []
        }
    };
    if (logicFlowData.nodes) {
        logicFlowData.nodes.forEach(v => {
            let step = {
                name: v.id,
                type: v.properties.pluginId || v.type,
                distribute: "N",
                copies: "1",
                dynamicInputFlag: "N",
                gui: {
                    xloc: v.x,
                    yloc: v.y,
                    "draw": "Y",
                    text: {x: v.text.x, y: v.text.y, value: v.text.value},
                    type: v.type,
                    id: v.id
                }, ...v.properties
            }
            step.name = v.id;
            delete step.logList;
            delete step.inputList;
            delete step.outputList;
            outJson.step.push(step);
        })
    }
    if (logicFlowData.edges) {
        logicFlowData.edges.forEach(v => {
            let hop = {
                from: v.sourceNodeId, to: v.targetNodeId, enabled: "Y", id: v.id, gui: {
                    id: v.id,
                    type: v.type,
                    text: v.text,
                    startPoint: v.startPoint,
                    pointsList: v.pointsList,
                    endPoint: v.endPoint
                }
            }
            outJson.order.hop.push(hop);
        })
    }
    return outJson;
}